home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1996-05-01 | 31.8 KB | 942 lines | [ TEXT/MPS ]
{ File: Power.p Contains: Power Manager Interfaces. Version: Technology: System 7.5 Release: Universal Interfaces 3.0d3 on Copland DR1 Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved. Bugs?: If you find a problem with this file, send the file and version information (from above) and the problem description to: Internet: apple.bugs@applelink.apple.com AppleLink: APPLE.BUGS } {$IFC UNDEFINED UsingIncludes} {$SETC UsingIncludes := 0} {$ENDC} {$IFC NOT UsingIncludes} UNIT Power; INTERFACE {$ENDC} {$IFC UNDEFINED __POWER__} {$SETC __POWER__ := 1} {$I+} {$SETC PowerIncludes := UsingIncludes} {$SETC UsingIncludes := 1} {$IFC UNDEFINED __TYPES__} {$I Types.p} {$ENDC} {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED } {$IFC UNDEFINED __MIXEDMODE__} {$I MixedMode.p} {$ENDC} {$ENDC} {$IFC FOR_SYSTEM8_PREEMPTIVE } {$IFC UNDEFINED __KERNEL__} {$I Kernel.p} {$ENDC} {$IFC UNDEFINED __NAMEREGISTRY__} {$I NameRegistry.p} {$ENDC} {$ENDC} {$PUSH} {$ALIGN MAC68K} {$LibExport+} {$IFC FOR_SYSTEM8_PREEMPTIVE } { ======================================================================================== The top of this file contains the Power Management interfaces used in Copland. The pre-Copland interfaces are below right after a large and obnoxious comment. ======================================================================================== } { //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• Low level (I/O architecture) interface //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• } { //------------------------------------------------------------------------------------ Power Management usage monitoring. High level families call PMMonitorUsage for each hardware device they maintain. Power management will periodically send messages to the family requesting the current UsageCount for each device. If power management determines that a device is idle it may be taken off-line. Prior to doing so power managment will send a message instructing the family to prepare for the device being off-line. When the device is reqired again the family uses PMPrepareDevice to instruct power management to bring the device back on-line. //------------------------------------------------------------------------------------ } TYPE PMUsageCount = UInt32; PMMonitorRef = ^LONGINT; FUNCTION PMMonitorUsage(VAR deviceToBeMonitored: RegEntryRef; adminMessageObject: ObjectID; refCon: UNIV Ptr; VAR newRef: PMMonitorRef): OSStatus; C; FUNCTION PMStopMonitoring(ref: PMMonitorRef): OSStatus; C; { //------------------------------------------------------------------------------------ Device Power State Management If a family maintains a device which is capable of switching between multiple power states, the family should inform power management of the device's capabilities and wait for messages directing it to change the device's power state. //------------------------------------------------------------------------------------ } CONST kPMDeviceDescriptionInitialVersion = 1; TYPE PMDeviceStateID = OSType; PMDeviceStateFlags = UInt32; CONST kPMDevicePoweredMask = $0001; { device powered vs. not } kPMDeviceConfiguredMask = $0002; { internal configuration retained vs. not } kPMDeviceUsableMask = $0004; { "on-line" vs "off-line" (usable or not) } kPMDevicePowerLowestMask = $0100; { set for device's highest state } kPMDevicePowerHighestMask = $0200; { set for device's lowest state } TYPE PMDeviceStatePtr = ^PMDeviceState; PMDeviceState = RECORD id: PMDeviceStateID; { state identifier - not interpreted by power management } relativeConsumption: UInt32; { relative ranking of power consumption } flags: PMDeviceStateFlags; { one or more of the bits defined above } END; PMDeviceDescriptionHdrPtr = ^PMDeviceDescriptionHdr; PMDeviceDescriptionHdr = RECORD version: UInt32; numberOfStates: UInt32; END; PMDeviceDescriptionPtr = ^PMDeviceDescription; PMDeviceDescription = RECORD header: PMDeviceDescriptionHdr; states: ARRAY [0..1] OF PMDeviceState; END; PMManageRef = ^LONGINT; FUNCTION PMManageDeviceState(VAR deviceToBeManaged: RegEntryRef; adminMessageObject: ObjectID; VAR deviceStates: PMDeviceDescription; descriptionSize: ByteCount; currentState: PMDeviceStateID; refCon: UNIV Ptr; VAR newRef: PMManageRef): OSStatus; C; FUNCTION PMNewDeviceState(manageRef: PMManageRef; VAR newStates: PMDeviceDescription; stateSize: ByteCount; currentState: PMDeviceStateID): OSStatus; C; FUNCTION PMStopManaging(ref: PMManageRef): OSStatus; C; { //------------------------------------------------------------------------------------ Power Management notification. Any entity in the I/O architecture can use these routines to be notified about changes to device. Clients use a mask to specify which device aspects they are interested in and also to specify when to be notified. Flags describing the new state are generated and delivered with the notification. If the client is interested in power being removed and re-applied, they can request it with (kPMNotifyAlwaysMask | kPMNotifyPowerMask). When the notification is delivered the client can check the new flags against kPMNotifyBeforeMask and kPMNotifyAfterMask to determine if the change has already occured or not. And can check against kPMDevicePoweredMask to determine if the device will have power or not in the new state. //------------------------------------------------------------------------------------ } TYPE PMNotifyFlags = UInt32; CONST kPMNotifyPowerMask = $00000001; kPMNotifyConfigurationMask = $00000002; kPMNotifyUsabilityMask = $00000004; kPMNotifyAllMask = $00000007; kPMNotifyBeforeMask = $40000000; { notification sent before change } kPMNotifyAfterMask = $80000000; { notification sent after change } kPMNotifyAlwaysMask = $C0000000; { notification sent before and after } TYPE PMNotifyRef = ^LONGINT; FUNCTION PMNotifyStateChange(VAR interestingDevice: RegEntryRef; adminMessageObject: ObjectID; notifyFlags: PMNotifyFlags; refCon: UNIV Ptr; VAR newRef: PMNotifyRef): OSStatus; C; FUNCTION PMStopNotification(ref: PMNotifyRef): OSStatus; C; { //------------------------------------------------------------------------------------ Power Management message This structure is used for all types of power management communication - usage monitoring, state change notification, and state change commands. //------------------------------------------------------------------------------------ } CONST kPMRetrieveUsageCountMessage = 1; kPMChangeDeviceStateMessage = 2; kPMNotifyStateChangeMessage = 3; TYPE PMMessageDataPtr = ^PMMessageData; PMMessageData = RECORD CASE INTEGER OF 0: ( newStateFlags: PMNotifyFlags; { used in kPMNotifyStateChangeMessage } ); 1: ( targetState: PMDeviceStateID; { used in kChangeDeviceStateMessage } ); END; PMMessagePtr = ^PMMessage; PMMessage = RECORD ampReserved: UInt32; { reserved for use by AdminMessagePort service } messageCode: UInt32; { one of the message codes above } refCon: Ptr; { } data: PMMessageData; { message-specific extra data } END; { //------------------------------------------------------------------------------------ Restoring an off-line or powered off device to a usable state. When a device that has been taken off-line or has had its power removed is needed again, the following routine should be called. This routine will return when after the device has been restored (or has failed to be restored). Part of the restoration process is delivering notifications to interested parties - kPMPowerRestore and/or kPMPrepareOnLine messages will be delivered and processed before this routine returns. //------------------------------------------------------------------------------------ } FUNCTION PMMakeDeviceUsable(VAR whichDevice: RegEntryRef): OSStatus; C; { //------------------------------------------------------------------------------------ Disabling & Re-Enabling power managment of a device. Power management of a specific device can be disabled - this may be desirable because of a resource reservation on some device. Families can implement a family specific API on top of this that can allow an application to turn off power management for a particular volume or display device. When power management of some device is disabled usage monitoring will still occur, but there will not be any requests to change the device state. The domain of which the device is a member will not be changed either. //------------------------------------------------------------------------------------ } FUNCTION PMDisablePowerManagement(VAR whichDevice: RegEntryRef): OSStatus; C; FUNCTION PMEnablePowerManagement(VAR whichDevice: RegEntryRef): OSStatus; C; { //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• Domain Controller Power Management Plug-In interface. //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• } { //------------------------------------------------------------------------------------ Domain description //------------------------------------------------------------------------------------ } CONST kPMDomainDescriptionInitialVersion = 1; TYPE PMDomainID = OSType; PMDomainLevelID = OSType; PMDomainLevelFlags = UInt32; CONST kPMDomainOffMask = $0000; kPMDomainFreezeMask = $0003; kPMDomainReducedMask = $0007; kPMDomainFullMask = $0207; TYPE PMDomainLevelPtr = ^PMDomainLevel; PMDomainLevel = RECORD levelID: PMDomainLevelID; flags: PMDomainLevelFlags; END; PMDomainDescriptionHdrPtr = ^PMDomainDescriptionHdr; PMDomainDescriptionHdr = RECORD descriptionVersion: UInt32; domainID: PMDomainID; numberOfLevels: UInt32; END; PMDomainDescriptionPtr = ^PMDomainDescription; PMDomainDescription = RECORD header: PMDomainDescriptionHdr; levels: ARRAY [0..1] OF PMDomainLevel; END; { //------------------------------------------------------------------------------------ Domain plugin. Plugin init routine returns pointer to a domain description as an out parameter. //------------------------------------------------------------------------------------ } CONST kPMDomainPluginVersion = $01000000; TYPE PMDomainPluginInitProc = ProcPtr; { FUNCTION PMDomainPluginInitProc(VAR domain: PMDomainDescriptionPtr; VAR numberOfDomains: UInt32): OSStatus; C; } PMDomainPluginSetLevelProc = ProcPtr; { FUNCTION PMDomainPluginSetLevelProc(domainID: PMDomainID; levelID: PMDomainLevelID): OSStatus; C; } PMDomainPluginDispatchTablePtr = ^PMDomainPluginDispatchTable; PMDomainPluginDispatchTable = RECORD version: UInt32; reserved: ARRAY [0..2] OF UInt32; init: PMDomainPluginInitProc; setLevel: PMDomainPluginSetLevelProc; END; { //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• Platform plugin. //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• } CONST kPMPlatformPluginVersion = $01000000; TYPE PMSleepProc = ProcPtr; { FUNCTION PMSleepProc(VAR services: OSType; numberOfServices: UInt32): OSStatus; C; } PMHibernateProc = ProcPtr; { FUNCTION PMHibernateProc(VAR services: OSType; numberOfServices: UInt32): OSStatus; C; } PMShutdownProc = ProcPtr; { FUNCTION PMShutdownProc(VAR services: OSType; numberOfServices: UInt32): OSStatus; C; } PMRestartProc = ProcPtr; { FUNCTION PMRestartProc(VAR services: OSType; numberOfServices: UInt32): OSStatus; C; } PMPlatformPluginPtr = ^PMPlatformPlugin; PMPlatformPlugin = RECORD version: UInt32; reserved: ARRAY [0..2] OF UInt32; sleep: PMSleepProc; hibernate: PMHibernateProc; shutdown: PMShutdownProc; restart: PMRestartProc; END; { //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• High level (application) interface. //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• } { Disk timer: the time a disk must be idle before it is spun down (or other power management actions are taken). Applies to all disks, but each disk has its own timer (one can stay spun up while the others are spun down). The minimum will be enforced. These API control system-wide parameters for the power management of disk devices. For control over a specific disk see the <Block Storage or File System> API. } CONST kPMDiskSpinDownDisabled = 0; FUNCTION PMSetDiskSpinDownTimeout(seconds: UInt32): OSStatus; C; FUNCTION PMGetDiskSpinDownTimeout: UInt32; C; FUNCTION PMGetMinimumDiskSpinDownTimeout: UInt32; C; { Display timer: the period of time in which there has been no user input before a display is dimmed or turned off. Applies to all displays, but each display has its own timer. The minimum will be enforced. } CONST kPMDisplayDimmingDisabled = 0; FUNCTION PMSetDisplayDimmingTimeout(seconds: UInt32): OSStatus; C; FUNCTION PMGetDisplayDimmingTimeout: UInt32; C; FUNCTION PMGetMinimumDisplayDimmingTimeout: UInt32; C; { Idle state timer: the period of time in which all devices must be idle before the system is [?]. Basically, this is the timer for whatever action the user chose to happen when the system is idle. Could be sleep, hibernate, or shutdown. If the user has explicitly disabled any action the routines return an error. The minimum will be enforced and will be greater than or equal to the maximum of disk spin down and display dimming times. } CONST kPMIdleStateDisabled = 0; FUNCTION PMSetIdleStateTimeout(seconds: UInt32): OSStatus; C; FUNCTION PMGetIdleStateTimeout: UInt32; C; FUNCTION PMGetMinimumIdleStateTimeout: UInt32; C; { Idle state: routines to get and set the action to be taken when power management has determined that the system is idle. Disabled: nothing happens when the machine is idle Sleep is a soft definition - depends on the hardware: differs between portable and desktop systems. Hibernate: save everthing and shutdown, on boot reload the saved state. Shutdown: just shutdown, nothing restored on boot. } CONST kPMIdleStateKindShutdown = 1; kPMIdleStateKindHibernate = 2; kPMIdleStateKindSleep = 3; FUNCTION PMSetIdleStateKind(idleStateKind: UInt32): OSStatus; C; FUNCTION PMGetIdleStateKind: UInt32; C; { Misc. timers: These allow for programmable shutdown and power on. These are real absolute times - turn off at 6:00pm Jan 12 and back on at 8:00am Feb 1. The 'DateAndTimeSpec' is a made-up placeholder. Shutdown is a real shutdown. IdleAction puts the machine into the chosen idle state - if the machine is shutdown at the that time nothing happens. PowerOn is either a normal boot or a return-from-idle depending on whether the system is shutdown or is in its idle state. } FUNCTION PMSetShutdownTime(when: ConstTimeObjectPtr): OSStatus; C; FUNCTION PMGetShutdownTime(when: TimeObjectPtr): OSStatus; C; FUNCTION PMSetIdleStateTime(when: ConstTimeObjectPtr): OSStatus; C; FUNCTION PMGetIdleStateTime(when: TimeObjectPtr): OSStatus; C; FUNCTION PMSetPowerOnTime(when: ConstTimeObjectPtr): OSStatus; C; FUNCTION PMGetPowerOnTime(when: TimeObjectPtr): OSStatus; C; { Immediate control over system state } FUNCTION PMRestart: OSStatus; C; FUNCTION PMEnterIdleState(idleStateKind: UInt32): OSStatus; C; { //------------------------------------------------------------------------------------ Other high level API. Other families may want to implement their own power management API that is built on top of the API presented here. Examples are the ability to turn off power management of a specific storage volume or a specific graphics display. The battery family will want/need to export a high level API that can show battery state. //------------------------------------------------------------------------------------ } { //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• User activity monitoring. These routine are used by software that is interested in the lack of and resumption of user activity. The usage model is as follows: software requests to be notified when all user activity has ceased for a specified amount of time. Once that notification has been delivered any user activity will cause the second notification to be delivered immediately. After delivery of the resume notification, the reference is invalid and software must request notification again if it so desires. //•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• } TYPE PMUserMonitorRef = ^LONGINT; FUNCTION PMMonitorUserActivity(minutesIdle: UInt32; VAR howToNotifyIdle: KernelNotification; VAR howToNotifyResume: KernelNotification; VAR newRef: PMUserMonitorRef): OSStatus; C; FUNCTION PMCancelMonitoring(refToCancel: PMUserMonitorRef): OSStatus; C; {$ENDC} { •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• Everything below this comment is the System 7.x Power Manager This comment is really large and obnoxious so that the separation can be easily found when scrolling through the file. •••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• } {$IFC FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED } CONST { Bit positions for ModemByte } modemOnBit = 0; ringWakeUpBit = 2; modemInstalledBit = 3; ringDetectBit = 4; modemOnHookBit = 5; { masks for ModemByte } modemOnMask = $01; ringWakeUpMask = $04; modemInstalledMask = $08; ringDetectMask = $10; modemOnHookMask = $20; { bit positions for BatteryByte } chargerConnBit = 0; hiChargeBit = 1; chargeOverFlowBit = 2; batteryDeadBit = 3; batteryLowBit = 4; connChangedBit = 5; { masks for BatteryByte } chargerConnMask = $01; hiChargeMask = $02; chargeOverFlowMask = $04; batteryDeadMask = $08; batteryLowMask = $10; connChangedMask = $20; { commands to SleepQRec sleepQProc } sleepRequest = 1; sleepDemand = 2; sleepWakeUp = 3; sleepRevoke = 4; sleepUnlock = 4; sleepDeny = 5; sleepNow = 6; dozeDemand = 7; dozeWakeUp = 8; dozeRequest = 9; { SleepQRec.sleepQFlags } noCalls = 1; noRequest = 2; slpQType = 16; sleepQType = 16; { bits in bitfield returned by PMFeatures } hasWakeupTimer = 0; { 1=wakeup timer is supported } hasSharedModemPort = 1; { 1=modem port shared by SCC and internal modem } hasProcessorCycling = 2; { 1=processor cycling is supported } mustProcessorCycle = 3; { 1=processor cycling should not be turned off } hasReducedSpeed = 4; { 1=processor can be started up at reduced speed } dynamicSpeedChange = 5; { 1=processor speed can be switched dynamically } hasSCSIDiskMode = 6; { 1=SCSI Disk Mode is supported } canGetBatteryTime = 7; { 1=battery time can be calculated } canWakeupOnRing = 8; { 1=can wakeup when the modem detects a ring } hasDimmingSupport = 9; { 1=has dimming support built in } hasStartupTimer = 10; { 1=startup timer is supported } { bits in bitfield returned by GetIntModemInfo and set by SetIntModemState } hasInternalModem = 0; { 1=internal modem installed } intModemRingDetect = 1; { 1=internal modem has detected a ring } intModemOffHook = 2; { 1=internal modem is off hook } intModemRingWakeEnb = 3; { 1=wakeup on ring is enabled } extModemSelected = 4; { 1=external modem selected } modemSetBit = 15; { 1=set bit, 0=clear bit (SetIntModemState) } { bits in BatteryInfo.flags } { ("chargerConnected" doesn't mean the charger is plugged in) } batteryInstalled = 7; { 1=battery is currently connected } batteryCharging = 6; { 1=battery is being charged } chargerConnected = 5; { 1=charger is connected to the PowerBook } HDPwrQType = $4844; { 'HD' hard disk spindown queue element type } PMgrStateQType = $504D; { 'PM' Power Manager state queue element type } { client notification bits in PMgrQueueElement.pmNotifyBits } pmSleepTimeoutChanged = 0; pmSleepEnableChanged = 1; pmHardDiskTimeoutChanged = 2; pmHardDiskSpindownChanged = 3; pmDimmingTimeoutChanged = 4; pmDimmingEnableChanged = 5; pmDiskModeAddressChanged = 6; pmProcessorCyclingChanged = 7; pmProcessorSpeedChanged = 8; pmWakeupTimerChanged = 9; pmStartupTimerChanged = 10; pmHardDiskPowerRemovedbyUser = 11; { System Activity Selectors } OverallAct = 0; { general type of activity } UsrActivity = 1; { user specific type of activity } NetActivity = 2; { network specific activity } HDActivity = 3; { Hard Drive activity } { Storage Media sleep mode defines } kMediaModeOn = 0; { Media active (Drive spinning and at full power) } kMediaModeStandBy = 1; { Media standby (not implemented) } kMediaModeSuspend = 2; { Media Idle (not implemented) } kMediaModeOff = 3; { Media Sleep (Drive not spinning and at min power, max recovery time) } kMediaPowerCSCode = 70; TYPE ActivityInfoPtr = ^ActivityInfo; ActivityInfo = RECORD ActivityType: INTEGER; { Type of activity to be fetched. Same as UpdateSystemActivity Selectors } ActivityTime: LONGINT; { Time of last activity (in ticks) of specified type. } END; { information returned by GetScaledBatteryInfo } BatteryInfoPtr = ^BatteryInfo; BatteryInfo = PACKED RECORD flags: UInt8; { misc flags (see below) } warningLevel: UInt8; { scaled warning level (0-255) } reserved: UInt8; { reserved for internal use } batteryLevel: UInt8; { scaled battery level (0-255) } END; ModemByte = SInt8; BatteryByte = SInt8; PMResultCode = LONGINT; SleepQRecPtr = ^SleepQRec; HDQueueElementPtr = ^HDQueueElement; PMgrQueueElementPtr = ^PMgrQueueElement; SleepQProcPtr = Register68kProcPtr; { FUNCTION SleepQ(message: LONGINT; qRecPtr: SleepQRecPtr): LONGINT; } HDSpindownProcPtr = ProcPtr; { PROCEDURE HDSpindown(VAR theElement: HDQueueElement); } PMgrStateChangeProcPtr = ProcPtr; { PROCEDURE PMgrStateChange(VAR theElement: PMgrQueueElement; stateBits: LONGINT); } SleepQUPP = UniversalProcPtr; HDSpindownUPP = UniversalProcPtr; PMgrStateChangeUPP = UniversalProcPtr; SleepQRec = RECORD sleepQLink: SleepQRecPtr; { pointer to next queue element } sleepQType: INTEGER; { queue element type (must be SleepQType) } sleepQProc: SleepQUPP; { pointer to sleep universal proc ptr } sleepQFlags: INTEGER; { flags } END; HDQueueElement = RECORD hdQLink: HDQueueElementPtr; { pointer to next queue element } hdQType: INTEGER; { queue element type (must be HDPwrQType) } hdFlags: INTEGER; { miscellaneous flags } hdProc: HDSpindownUPP; { pointer to routine to call } hdUser: LONGINT; { user-defined (variable storage, etc.) } END; PMgrQueueElement = RECORD pmQLink: PMgrQueueElementPtr; { pointer to next queue element } pmQType: INTEGER; { queue element type (must be PMgrStateQType) } pmFlags: INTEGER; { miscellaneous flags } pmNotifyBits: LONGINT; { bitmap of which changes to be notified for } pmProc: PMgrStateChangeUPP; { pointer to routine to call } pmUser: LONGINT; { user-defined (variable storage, etc.) } END; BatteryTimeRecPtr = ^BatteryTimeRec; BatteryTimeRec = RECORD expectedBatteryTime: LONGINT; { estimated battery time remaining (seconds) } minimumBatteryTime: LONGINT; { minimum battery time remaining (seconds) } maximumBatteryTime: LONGINT; { maximum battery time remaining (seconds) } timeUntilCharged: LONGINT; { time until battery is fully charged (seconds) } END; WakeupTimePtr = ^WakeupTime; WakeupTime = RECORD wakeTime: LONGINT; { wakeup time (same format as current time) } wakeEnabled: BOOLEAN; { 1=enable wakeup timer, 0=disable wakeup timer } filler: SInt8; END; StartupTimePtr = ^StartupTime; StartupTime = RECORD startTime: LONGINT; { startup time (same format as current time) } startEnabled: BOOLEAN; { 1=enable startup timer, 0=disable startup timer } filler: SInt8; END; FUNCTION DisableWUTime: OSErr; FUNCTION SetWUTime(WUTime: LONGINT): OSErr; FUNCTION GetWUTime(VAR WUTime: LONGINT; VAR WUFlag: SignedByte): OSErr; FUNCTION BatteryStatus(VAR Status: SignedByte; VAR Power: SignedByte): OSErr; FUNCTION ModemStatus(VAR Status: SignedByte): OSErr; FUNCTION IdleUpdate: LONGINT; {$IFC NOT GENERATINGCFM} INLINE $A285, $2E80; {$ENDC} FUNCTION GetCPUSpeed: LONGINT; {$IFC NOT GENERATINGCFM} INLINE $70FF, $A485, $2E80; {$ENDC} PROCEDURE EnableIdle; {$IFC NOT GENERATINGCFM} INLINE $7000, $A485; {$ENDC} PROCEDURE DisableIdle; {$IFC NOT GENERATINGCFM} INLINE $7001, $A485; {$ENDC} PROCEDURE SleepQInstall(qRecPtr: SleepQRecPtr); {$IFC NOT GENERATINGCFM} INLINE $205F, $A28A; {$ENDC} PROCEDURE SleepQRemove(qRecPtr: SleepQRecPtr); {$IFC NOT GENERATINGCFM} INLINE $205F, $A48A; {$ENDC} PROCEDURE AOn; {$IFC NOT GENERATINGCFM} INLINE $7004, $A685; {$ENDC} PROCEDURE AOnIgnoreModem; {$IFC NOT GENERATINGCFM} INLINE $7005, $A685; {$ENDC} PROCEDURE BOn; {$IFC NOT GENERATINGCFM} INLINE $7000, $A685; {$ENDC} PROCEDURE AOff; {$IFC NOT GENERATINGCFM} INLINE $7084, $A685; {$ENDC} PROCEDURE BOff; {$IFC NOT GENERATINGCFM} INLINE $7080, $A685; {$ENDC} { Public Power Management API (NEW!) } FUNCTION PMSelectorCount: INTEGER; {$IFC NOT GENERATINGCFM} INLINE $7000, $A09E, $3E80; {$ENDC} FUNCTION PMFeatures: LONGINT; {$IFC NOT GENERATINGCFM} INLINE $7001, $A09E, $2E80; {$ENDC} FUNCTION GetSleepTimeout: ByteParameter; {$IFC NOT GENERATINGCFM} INLINE $7002, $A09E, $1E80; {$ENDC} PROCEDURE SetSleepTimeout(timeout: ByteParameter); {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $0003, $A09E; {$ENDC} FUNCTION GetHardDiskTimeout: ByteParameter; {$IFC NOT GENERATINGCFM} INLINE $7004, $A09E, $1E80; {$ENDC} PROCEDURE SetHardDiskTimeout(timeout: ByteParameter); {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $0005, $A09E; {$ENDC} FUNCTION HardDiskPowered: BOOLEAN; {$IFC NOT GENERATINGCFM} INLINE $7006, $A09E, $1E80; {$ENDC} PROCEDURE SpinDownHardDisk; {$IFC NOT GENERATINGCFM} INLINE $7007, $A09E; {$ENDC} FUNCTION IsSpindownDisabled: BOOLEAN; {$IFC NOT GENERATINGCFM} INLINE $7008, $A09E, $1E80; {$ENDC} PROCEDURE SetSpindownDisable(setDisable: BOOLEAN); {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $0009, $A09E; {$ENDC} FUNCTION HardDiskQInstall(VAR theElement: HDQueueElement): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $700A, $A09E, $3E80; {$ENDC} FUNCTION HardDiskQRemove(VAR theElement: HDQueueElement): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $700B, $A09E, $3E80; {$ENDC} PROCEDURE GetScaledBatteryInfo(whichBattery: INTEGER; VAR theInfo: BatteryInfo); {$IFC NOT GENERATINGCFM} INLINE $205F, $301F, $4840, $303C, $000C, $A09E, $2080; {$ENDC} PROCEDURE AutoSleepControl(enableSleep: BOOLEAN); {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $000D, $A09E; {$ENDC} FUNCTION GetIntModemInfo: LONGINT; {$IFC NOT GENERATINGCFM} INLINE $700E, $A09E, $2E80; {$ENDC} PROCEDURE SetIntModemState(theState: INTEGER); {$IFC NOT GENERATINGCFM} INLINE $301F, $4840, $303C, $000F, $A09E; {$ENDC} FUNCTION MaximumProcessorSpeed: INTEGER; {$IFC NOT GENERATINGCFM} INLINE $7010, $A09E, $3E80; {$ENDC} FUNCTION CurrentProcessorSpeed: INTEGER; {$IFC NOT GENERATINGCFM} INLINE $7011, $A09E, $3E80; {$ENDC} FUNCTION FullProcessorSpeed: BOOLEAN; {$IFC NOT GENERATINGCFM} INLINE $7012, $A09E, $1E80; {$ENDC} FUNCTION SetProcessorSpeed(fullSpeed: BOOLEAN): BOOLEAN; {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $0013, $A09E, $1E80; {$ENDC} FUNCTION GetSCSIDiskModeAddress: INTEGER; {$IFC NOT GENERATINGCFM} INLINE $7014, $A09E, $3E80; {$ENDC} PROCEDURE SetSCSIDiskModeAddress(scsiAddress: INTEGER); {$IFC NOT GENERATINGCFM} INLINE $301F, $4840, $303C, $0015, $A09E; {$ENDC} PROCEDURE GetWakeupTimer(VAR theTime: WakeupTime); {$IFC NOT GENERATINGCFM} INLINE $205F, $7016, $A09E; {$ENDC} PROCEDURE SetWakeupTimer(VAR theTime: WakeupTime); {$IFC NOT GENERATINGCFM} INLINE $205F, $7017, $A09E; {$ENDC} FUNCTION IsProcessorCyclingEnabled: BOOLEAN; {$IFC NOT GENERATINGCFM} INLINE $7018, $A09E, $1E80; {$ENDC} PROCEDURE EnableProcessorCycling(enable: BOOLEAN); {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $0019, $A09E; {$ENDC} FUNCTION BatteryCount: INTEGER; {$IFC NOT GENERATINGCFM} INLINE $701A, $A09E, $3E80; {$ENDC} FUNCTION GetBatteryVoltage(whichBattery: INTEGER): Fixed; {$IFC NOT GENERATINGCFM} INLINE $301F, $4840, $303C, $001B, $A09E, $2E80; {$ENDC} PROCEDURE GetBatteryTimes(whichBattery: INTEGER; VAR theTimes: BatteryTimeRec); {$IFC NOT GENERATINGCFM} INLINE $205F, $301F, $4840, $303C, $001C, $A09E; {$ENDC} FUNCTION GetDimmingTimeout: ByteParameter; {$IFC NOT GENERATINGCFM} INLINE $701D, $A09E, $1E80; {$ENDC} PROCEDURE SetDimmingTimeout(timeout: ByteParameter); {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $001E, $A09E; {$ENDC} PROCEDURE DimmingControl(enableSleep: BOOLEAN); {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $001F, $A09E; {$ENDC} FUNCTION IsDimmingControlDisabled: BOOLEAN; {$IFC NOT GENERATINGCFM} INLINE $7020, $A09E, $1E80; {$ENDC} FUNCTION IsAutoSlpControlDisabled: BOOLEAN; {$IFC NOT GENERATINGCFM} INLINE $7021, $A09E, $1E80; {$ENDC} FUNCTION PMgrStateQInstall(VAR theElement: PMgrQueueElement): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $7022, $A09E, $3E80; {$ENDC} FUNCTION PMgrStateQRemove(VAR theElement: PMgrQueueElement): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $7023, $A09E, $3E80; {$ENDC} FUNCTION UpdateSystemActivity(activity: ByteParameter): OSErr; {$IFC NOT GENERATINGCFM} INLINE $101F, $4840, $303C, $0024, $A09E, $3E80; {$ENDC} FUNCTION DelaySystemIdle: OSErr; {$IFC NOT GENERATINGCFM} INLINE $7025, $A09E, $3E80; {$ENDC} FUNCTION GetStartupTimer(VAR theTime: StartupTime): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $7026, $A09E, $3E80; {$ENDC} FUNCTION SetStartupTimer(VAR theTime: StartupTime): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $7027, $A09E, $3E80; {$ENDC} FUNCTION GetLastActivity(VAR theActivity: ActivityInfo): OSErr; {$IFC NOT GENERATINGCFM} INLINE $205F, $7028, $A09E, $3E80; {$ENDC} CONST uppSleepQProcInfo = $00131832; uppHDSpindownProcInfo = $000000C0; uppPMgrStateChangeProcInfo = $000003C0; FUNCTION NewSleepQProc(userRoutine: SleepQProcPtr): SleepQUPP; {$IFC NOT GENERATINGCFM } INLINE $2E9F; {$ENDC} FUNCTION NewHDSpindownProc(userRoutine: HDSpindownProcPtr): HDSpindownUPP; {$IFC NOT GENERATINGCFM } INLINE $2E9F; {$ENDC} FUNCTION NewPMgrStateChangeProc(userRoutine: PMgrStateChangeProcPtr): PMgrStateChangeUPP; {$IFC NOT GENERATINGCFM } INLINE $2E9F; {$ENDC} FUNCTION CallSleepQProc(message: LONGINT; qRecPtr: SleepQRecPtr; userRoutine: SleepQUPP): LONGINT; {$IFC NOT GENERATINGCFM} {To be implemented: Glue to move parameters into registers.} {$ENDC} PROCEDURE CallHDSpindownProc(VAR theElement: HDQueueElement; userRoutine: HDSpindownUPP); {$IFC NOT GENERATINGCFM} INLINE $205F, $4E90; {$ENDC} PROCEDURE CallPMgrStateChangeProc(VAR theElement: PMgrQueueElement; stateBits: LONGINT; userRoutine: PMgrStateChangeUPP); {$IFC NOT GENERATINGCFM} INLINE $205F, $4E90; {$ENDC} {$ENDC} {$ALIGN RESET} {$POP} {$SETC UsingIncludes := PowerIncludes} {$ENDC} {__POWER__} {$IFC NOT UsingIncludes} END. {$ENDC}